<?php
require_once("BaseNews.php");
require_once("MysqlConn.php");

class News_W extends BaseNews {
   public function setTitle($title) {
      $this->title = $title;
   }

   public function setContent($content) {
      $this->content = $content;
   }

   public function insertDB() {
      $query = "Insert into News (NEW_TITLE, NEW_CONTENT) " .
         "values ('$this->title', '$this->content')";
      $conn = new MysqlConn();
      $conn->query($query);

      return $conn->getErrNo() > 0 ? $conn->getErrNo() : 0;
   }
}
?>